import 'package:flutter/foundation.dart';
import 'package:get/get.dart';
import '../../widget/input_dialog/input_dialog_util.dart';
import 'general_dialog_state.dart';
import '../../widget/general_dialog/general_dialog_util.dart';

class GeneralDialogLogic extends GetxController {
  final GeneralDialogState state = GeneralDialogState();

  @override
  void onInit() {
    var map = Get.arguments;
    state.title = map["title"];
    super.onInit();
  }

  /// 显示通用对话框
  void showGeneralDialog() {
    GeneralDialogUtil().showGeneralDialogWidget("退出提示", "确认要退出登录吗?",
        leftActionEvent: () {
      // 取消点击事件
    }, rightActionEvent: () {
      // 确定点击事件
    });
  }

  /// 显示文本对话框
  void showInputDialog() {
    InputDialogUtil().showInputDialogWidget("解锁房间",
        sureEvent: (String? content) {
      //点击确定事件
      if (kDebugMode) {
        print("content=====$content");
      }
    });
  }
}
